/**
* use to validate phone number example 84973550940 or 84123456789
*/
$(document).ready(function(){
    $('#phone_mobile').blur(function(){  
        val = $(this).val();
        if(val != ''){
            pattern = /^84[1-9]{1}[0-9]{8,9}$/;//  /^(84)\d{8,9}$/;
            ; // '/^84(\+\d)'; //'/^\84/\d';
            if(!val.match(pattern)){
                $(this).css({'background-color' : 'red'});
                alert(SUGAR.language.get('app_strings', 'LBL_PHONE_VALIDATE_MSG'));
                $('#phone_mobile').focus();
            }else{
                $(this).css({'background-color' : 'white'});
            } 
        }
    })
})
function validatePhoneNumber(){
    pattern = /^84[1-9]{8,9}$/;//  /^(84)\d{8,9}$/;
    ; // '/^84(\+\d)'; //'/^\84/\d';
    val = $('#phone_number').val();
    if(!val.match(pattern)){
        alert('false');
    }
}
